<div style="height:auto;width:100%">
<table class="tblInfo" id="frminventory_tblinfo" width="100%">
<tr>
<td class="width25" height="400" valign="top"> 
<table class="info" id="frminventory_info">
<tr>
<td>
<div  class="divleft">
<!--<table class="width100">
<tr >
<td  class="lblRequired width30">Thời gian</td>
<td ><input id="frminventory_date1" class="datereport txtRequired width35" onblur="formatddmmyyyy(this)" maxlength="10"  /><a href="javascript:frminventory_cal1.popup();"><img src="adagps.com/images/cal/cal2.png" id="frminventory_imgcal1"  class="datepicker dpkstart" ></a>
-<input id="frminventory_date2"  class="datereport txtRequired width35" onblur="formatddmmyyyy(this)" maxlength="10" /><a href="javascript:frminventory_cal2.popup();"><img src="adagps.com/images/cal/cal2.png" id="frminventory_imgcal2"  class="datepicker dpkstart" ></a>
</td>
</tr>       
</table> -->
<div class="divactionbuton">
        <button id="frmreportdetail_create" class="search1" onclick="frminventory_createReport();" type="button"> Xem </button>
    </div>  
</div>
</td>
</tr>
<tr >
<td >

</td>
</tr>
</table>
</td>
<td class="clsmiddle"></td>
<td height="400" valign="top" align="center">
<!--<div id="frminventory_divDetail" class="divDialog" align="center"> 
<table class="width100">
<tr>
<td class="width100">
<div id="frminventory_divDetail_grid" >
</div> 
</td>
</tr>
<tr>
<td>
<button class="cancelDialog"> Đóng</button>
</td>
</tr>
</table>
</div> -->
<div id="frminventory_divGrid" class="divGrid"></div></td>
<td class="clsend"></td>
</tr>
</table>
 <script language="javascript">
 changeWaiting(0);
$(document).ready(function () {
    initForm('frminventory_tblinfo');
    initDivleft();
/*    $('#frminventory_divDetail').dialog({
        autoOpen: false,
        modal: true,
        width: 800,
        resizable: true,
        overflow: 'auto' 
    }); */
});

function frminventory_createReport(){
    changeWaiting(0);
    xajax_frminventory_loadGrid();  
}

function frminventory_update(obj){
     cntlid = obj.id;
     arr = cntlid.split('_');
     id = arr[2];
    realnum =parseInt($('#frminventory_txtrealnum_'+id).val().replace(/,/gi, ""));
    logicnum = parseInt($('#frminventory_tdlogicnum_'+id).html().replace(/,/gi, ""));
    name = $('#frminventory_tdname_'+id).html(); 
    if(realnum==logicnum){
        
        alert('Bạn chưa điều chỉnh số lượng thực tế của \n ['+ name + '] so vơi số lượng tồn kho!');
        return;
    }else{
        if(confirm('Bạn có chắc điều chỉnh số lượng tồn kho của \n ['+ name + '] từ ' + logicnum + ' thành ' + realnum +'?')){
            changeWaiting(0);
            xajax_frminventory_update(id,logicnum,realnum);
        }
    } 
    
}
frminventory_createReport();
 </script>